package org.baseflexcharts.datapoints
{
	import flash.display.Shape;
	import flash.events.MouseEvent;
	
	import mx.core.UIComponent;
	
	public class RoundPoint extends UIComponent
	{
		
		private var _ram:uint;
		
		private var _lineColor:uint;
		
		private var _lineWeight:uint;
		
		private var _lineAlpha:Number;
		
		private var _fillColor:uint;
		
		public function RoundPoint(toolTip:String = "", ram:uint = 2, lineColor:uint = 0x000000, fillColor:uint = 0xffffff, lineWeight:uint = 1, lineAlpha:uint = 1)
		{
			super();
			
			this.ram = ram;
			this.lineColor = lineColor;
			this.fillColor = fillColor;
			this.lineWeight = lineWeight;
			this.lineAlpha = lineAlpha;
			this.toolTip = toolTip;
			
			draw();
			this.addEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler);
			this.addEventListener(MouseEvent.MOUSE_OUT, mouseOutHandler);
		}
		
		public function draw():void
		{	
			this.graphics.clear();
			
			this.graphics.lineStyle(lineWeight, lineColor, lineAlpha);
			this.graphics.beginFill(fillColor);
			this.graphics.drawCircle(0, 0, ram);
			this.graphics.endFill();
		}
		
		private function mouseOverHandler(event:MouseEvent):void
		{
			this.graphics.clear();
			
			this.graphics.lineStyle(lineWeight, lineColor, lineAlpha);
			this.graphics.beginFill(fillColor);
			this.graphics.drawCircle(0, 0, ram + 2);
			this.graphics.endFill();
		}
		
		private function mouseOutHandler(event:MouseEvent):void
		{
			draw();
		}
		
		public function get ram():uint
		{
			return this._ram;
		}
		
		public function set ram(data:uint):void
		{
			this._ram = data;
		}
		
		public function get lineWeight():uint
		{
			return this._lineWeight;
		}
		
		public function set lineWeight(data:uint):void
		{
			this._lineWeight = data;
		}
		
		public function get lineColor():uint
		{
			return this._lineColor;
		}
		
		public function set lineColor(data:uint):void
		{
			this._lineColor = data;
		}
		
		public function get fillColor():uint
		{
			return this._fillColor;
		}
		
		public function set fillColor(data:uint):void
		{
			this._fillColor = data;
		}
		
		public function get lineAlpha():Number
		{
			return this._lineAlpha;
		}
		
		public function set lineAlpha(data:Number):void
		{
			this._lineAlpha = data;
		}
	}
}